package com.ljj;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 19182
 * Date: 2025-11-11
 * Time: 17:02
 */
@RestController
@RequestMapping("/hello")
public class HelloController {
    @RequestMapping("/hello1")
    public String hello1(){
        return "hello spring MVC 1";
    }
    //多个请求方法用花括号括起来s
    @RequestMapping(value = "/hello2", method = {RequestMethod.GET, RequestMethod.POST})
    public String hello2(){
        return "hello spring MVC 2";
    }

}
